picoGA: A Vectorized Implementation of a Genetic Algorithm in Matlab
نویسنده
چکیده
This document describes picoGA, our submission to the Tiny GA programming competition at GECCO 2006. picoGA is optimized to have small code size and a small memory footprint. It is implemented in the Matlab programming language. Matlab is an interpretted language that is optimized for performing operations on arrays. Loops, especially nested loops, tend to run slowly in Matlab. It is possible however to significantly improve the performance of Matlab programs by converting loops into array operations. This process is called vectorization (see [1] for further information). Matlab provides a rich set of functions, and many expressive indexing schemes that make it possible to vectorize code. Vectorized code not only runs faster, it also requires fewer lines of code. A drawback of vectorization is that it sometimes results in the consumption of more memory. Another drawback is that vectorized code can be harder to understand for users who are new to Matlab programming. In our submission we have sought to create a GA implementation that balances the costs and benefits of vectorization. There are some loops that we could have been vectorized to reduce the number of lines of code and to improve the performance of picoGA, however because the vectorization of these loops would have resulted in a drastic increase in the memory footprint, and because performance is not one of the criteria of the competition we decided to leave these loops unchanged. We will point out places where we made such decisions, and show what the vectorized code might have been in each case. In other places vectorization allowed for a big reduction in program size without drastically affecting the memory footprint. In such cases we have vectorized the code. For sophisticated users of Matlab, vectorization oftentimes improves the clarity of code, however it can make matters more difficult for others. Hence, in this document, we will explain how our vectorized code works. In the next section we describe features of our code that are relevant to the Tiny GA competition. In the following section we visit places in the code where we have implemented vectorization, and other places where we have avoided it. We will assume that readers are familiar with the vector indexing and logical indexing syntax of Matlab. For an introduction to this syntax see [2]
منابع مشابه
Vectorized Matlab codes for linear two-dimensional elasticity
A vectorized Matlab implementation for the P1 finite element is provided for the twodimensional linear elasticity with mixed boundary conditions. Vectorization means that there is no loop over triangles. Numerical experiments show that our implementation is more efficient than the standard implementation with a loop over all triangles.
متن کاملA Technique for Improving Web Mining using Enhanced Genetic Algorithm
World Wide Web is growing at a very fast pace and makes a lot of information available to the public. Search engines used conventional methods to retrieve information on the Web; however, the search results of these engines are still able to be refined and their accuracy is not high enough. One of the methods for web mining is evolutionary algorithms which search according to the user interests...
متن کاملPractical Guide to Matrix Calculus for Deep Learning
Several learning algorithms require computing the gradient of a training objective. This document is a guide to expressing such gradients in vectorized form, i.e. where inputs, parameters, and intermediate values are all matrices. A vectorized gradient expression can be directly implemented in Matlab/Numpy, making use of highly-optimized numerical libraries.
متن کاملGENETIC ALGORITHM BASED EQUIPMENT SELECTION METHOD FOR CONSTRUCTION PROJECT USING MATLAB TOOL
Equipment selection is a key factor in modern construction industry. As it is a complex factor, current models offered by literatures fail to provide adequate solutions for major issues like systematic evaluation of soft factors and weighting of soft benefits in comparison with costs. This paper aims at making a comparative study between GA and AHP by utilising MATLAB as a tool. It is a conveni...
متن کاملSoftware Implementation and Experimentation with a New Genetic Algorithm for Layout Design
This paper discusses the development of a new GA for layout design. The GA was already designed and reported. However the implementation used in the earlier work was rudimentary and cumbersome, having no suitable Graphical User Interface, GUI. This paper discusses the intricacies of the algorithm and the GA operators used in previous work. It also reports on implementation of a new GA operator ...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2006